﻿<Application 
    x:Class="WindowsPhoneDataBoundApplication1.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:nav="clr-namespace:System.Windows.Navigation;assembly=Microsoft.Phone" 
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    >

    <!--Application Resources-->
    <Application.Resources>
        <system:String x:Key="AppName">CONTROLS &amp; NAVIGATION</system:String>
        <shell:ApplicationBar x:Key="MainAppBar">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="About" Click="ApplicationBarMenuItem_Click"/>
                <shell:ApplicationBarMenuItem Text="Gallery" Click="ApplicationBarMenuItem_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>

        <nav:UriMapper x:Key="uriMapper">
            <nav:UriMapping Uri="/About" MappedUri="/Views/About.xaml" />
            <nav:UriMapping Uri="/Gallery" MappedUri="/Views/Gallery.xaml" />
            <nav:UriMapping Uri="/Album/{Id}" MappedUri="/Views/Album.xaml?Id={Id}" />
        </nav:UriMapper>
    </Application.Resources>   

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>
